package msearch.upload;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;


public class Uploader {
	public static final String path="D:\\mp3uploaded\\";
	public static void saveToLocal(InputStream is){
		try{
		OutputStream os = new FileOutputStream(new File(path+System.currentTimeMillis()+".txt"));
		byte[] tmp = new byte[1024];
		int a=0;
		while((a=is.read(tmp))>0){
			os.write(tmp,0,a);
			
		}
		os.flush();
		is.close();
		os.close();
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}
}
